<template>
	<view class="main">
		<u-navbar :is-back="true" :title="i18n.navbar.transfer_info" :background="background" :border-bottom="false" title-color="#000000"
			back-icon-color="#000">
		</u-navbar>
		<view class="all">
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.money}}
				</view>
				<text class="cont">{{transferData.amount}}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.pay_method}}
				</view>
				<text class="cont">{{ transferData.transferType == 'bank' ? i18n.transfer_record.Transfer_type_bank : i18n.transfer_record.Transfer_type_online }}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.deposit_bank}}
				</view>
				<text class="cont">{{transferData.transferBank}}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.bank_account}}
				</view>
				<text class="cont">{{transferData.transferBankCard}}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.Account_name}}
				</view>
				<text class="cont">{{transferData.transferName}}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.status}}
				</view>
				<text class="cont">{{ transferData.auditStatus == 0 ? i18n.transfer_record.selecstatus_not_reviewed : transferData.auditStatus == 1 ? i18n.transfer_record.selecstatus_reviewed : i18n.transfer_record.selecstatus_failed }}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_record.Receipt_status}}
				</view>
				<text class="cont">{{ transferData.transferStatus == 1 ? i18n.transfer_record.transfer_status_received : i18n.transfer_record.transfer_status_not_received }}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.time}}
				</view>
				<text class="cont">{{transferData.auditTime  | filterEmpty}}</text>
			</view>
			<view class="info" v-if="transferData.refusalReason !=null && transferData.refusalReason.length>0">
				<view class="title">
					{{i18n.transfer_info.refusal_reason}}
				</view>
				<text class="cont">{{transferData.refusalReason}}</text>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.voucher}}
				</view>
				<view class="info_img">
					<u-image width="100%" height="100%" :src="transferData.transferProof" @click="previewImage(transferData.transferProof)"/>
				</view>
			</view>
			<view class="info">
				<view class="title">
					{{i18n.transfer_info.remarke}}
				</view>
				<text class="cont">{{transferData.mark | filterEmpty}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		filters: {
			filterEmpty(val) {
				let _result = '-'
				if (!val) {
				return _result
				}
				_result = val
				return _result
			}
		},
		data() {
			return {
				background: {
					backgroundColor: '#fff',
				},
				count: 5, //评分个数
				value: 2,
				checked: false,
				id: 0,
				transferData: {},
			}
		},
		computed: {
			i18n() {
				return this.$t('message')
			},
		},
		onShow() {
			this.lang()
			this.id = this.$route.query.id;
			this.getTransferData();
		},
		methods: {
			lang() {
				this._i18n.locale = uni.getStorageSync('select')
			},
			getTransferData() {
				this.status = 'loading';
				if(this.currentPage>0 && this.totalPage>0 && this.currentPage>=this.totalPage){
					this.status = 'nomore';
					return
				}
				global.$http.request({
					url: '/api/admin/merchant/finance/transfer/record/info/'+this.id,
					header: {
							'Authori-zation':  uni.getStorageSync('token') //自定义请求头信息
						},
					method: 'GET',
				}).then(res => {
					if (res.data.code == 200) {
						this.transferData = res.data.data;
					}
				})
			},
			// 预览图片
			previewImage(url){
				if(!url){
					return
				}
				var urls = [];
				urls.push(url);
				uni.previewImage({
					urls: urls,
					longPressActions: {
						success: function(data) {
						},
						fail: function(err) {
						}
					}
				});
				
			},
			router(path){
				console.log(1);
				uni.navigateTo({
					url:path
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		font-family: PingFang SC;
		background-color: #f7f7f7;

		.main {

			.shop_info {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #304156;
				padding-right: 19rpx;
			}

			.all {
				margin-top: 10rpx;

				.info {
					background-color: #fff;
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding: 31rpx 22rpx;
					margin-bottom: 2rpx;

					.title {
						font-size: 28rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #000000;
					}

					.info_img {
						width: 110rpx;
						height: 110rpx;

						image {
							width: 110rpx;
							height: 110rpx;
						}
					}

					.cont {
						font-size: 28rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #808080;
					}
				}
			}
		}
	}
</style>
